using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
    [Serializable]
    public partial class HOANCANHKINHTEModel : ObjModel<HOANCANHKINHTE>, IModelConverter
    {

        #region Constructor

        public HOANCANHKINHTEModel()
            : base()
        {
        }

        public HOANCANHKINHTEModel(HOANCANHKINHTE obj)
            : base(obj)
        {
        }

        #endregion

        #region Fields

        private System.Guid? _mahoancanhkinhte;

        private System.String _tenhoancanhkinhte;

        private System.Int32? _priority;

        #endregion

        #region Properties

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.Guid? MAHOANCANHKINHTE
        {
            get
            {
                return _mahoancanhkinhte;
            }
            set
            {
                _mahoancanhkinhte = value;
            }
        }

        //[Store]
        [Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        [StringLength(1000, ErrorMessage = "Value must be under 1000 characters")]
        //[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        //[IntergerRegx]
        //[RealIntergerRegx]
        public System.String TENHOANCANHKINHTE
        {
            get
            {
                return _tenhoancanhkinhte;
            }
            set
            {
                _tenhoancanhkinhte = value;
            }
        }

        //[Store]
        //[Required(ErrorMessage = "Value is required")]
        //[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
        //[StringLength(0)]
        ////[EmailRegx]
        //[NumberRegx]
        //[RealNumberRegx]
        [IntergerRegx]
        //[RealIntergerRegx]
        public System.Int32? PRIORITY
        {
            get
            {
                return _priority;
            }
            set
            {
                _priority = value;
            }
        }

        #endregion

        #region IModelConverter

        public System.Type Reflector()
        {
            return typeof(HOANCANHKINHTEModel);
        }
        public object GetModel()
        {
            return this;
        }

        #endregion

        #region Overrides of Model<HOANCANHKINHTE>

        public override void ReverttoModel()
        {
            CreateModel(this);
        }

        public override HOANCANHKINHTE ReverttoBussiness()
        {
            return CreateBussiness(this);
        }

        #endregion

        #region Operators

        public static implicit operator HOANCANHKINHTEModel(HOANCANHKINHTE obj)
        {
            return new HOANCANHKINHTEModel(obj);
        }
        public static implicit operator HOANCANHKINHTE(HOANCANHKINHTEModel obj)
        {
            return obj.ReverttoBussiness();
        }

        #endregion

    }
}
